<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"> 

<h:head>
<title>
TravelDream
</title>
	<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'/>
		<h:outputStylesheet library="css" name="userHomePage.css"/>
	
</h:head> 

<body> 
	<h:outputStylesheet library="css" name="primefaces-style.css"/>
<div id="header">
		<div id="logo">
			<h:link outcome="homePage" >
				<h:outputText id="logo" value="TravelDream" />
			</h:link>
		</div>
		
		<div id="userInfo">
			<h:link outcome="userInfo" >
			<h:outputText id="userName" value="#{searchBar.currentUser.firstName}" />
			</h:link>	
			
		</div>
		
		<div id="logout">
			<h:form>
				<p:commandButton id="logoutButton" value="logout" action="#{logout.logout()}"/>
			</h:form>
		</div>
	</div>
	
	<div id="lineHome">
	
	</div>
	
	<div id="content">
		<p:panel header="User Info">
			<p:panel header="General">
			<p:panelGrid columns="2" cellpadding="3">
			
				<h:outputText value="Email" />
				<h:outputText value="#{userInfo.currentUser.email}" />
				
				<h:outputText value="First Name" />
				<h:outputText value="#{userInfo.currentUser.firstName}" />
				
				<h:outputText value="Last Name" />
				<h:outputText value="#{userInfo.currentUser.lastName}" />

			</p:panelGrid>
			</p:panel>
			
			
			<p:panel header="Prenotation">
					<p:dataTable id="prenotationDataTable" var="PrenotationDTO"
							value="#{userInfo.allUserPrenotationDTO}">
						<f:facet name="header">  
          					All Prenotations  
       					</f:facet>
       					
						<p:column headerText="Package Name">
							<h:outputText value="#{PrenotationDTO.packageName}" />
						</p:column>
						<p:column headerText="Outgoing Flight">
							<p:panelGrid columns="2" cellpadding="3">
								<h:outputText value="Id" />
								<h:outputText value="#{PrenotationDTO.departureFlight.id}" />
								
								<h:outputText value="Date" />
								<h:outputText value="#{PrenotationDTO.departureFlight.data}" />
								
								<h:outputText value="Departure city" />
								<h:outputText value="#{PrenotationDTO.departureFlight.departureCity}" />
								
								<h:outputText value="Arrival city" />
								<h:outputText value="#{PrenotationDTO.departureFlight.arrivalCity}" />
								
								<h:outputText value="Price" />
								<h:outputText value="#{PrenotationDTO.departureFlight.price}" />
							</p:panelGrid>
						</p:column>
							
							
							<p:column headerText="Return Flight">
							<p:panelGrid columns="2" cellpadding="3">
								<h:outputText value="Id" />
								<h:outputText value="#{PrenotationDTO.returnFlight.id}" />
								
								<h:outputText value="Date" />
								<h:outputText value="#{PrenotationDTO.returnFlight.data}" />
								
								<h:outputText value="Departure city" />
								<h:outputText value="#{PrenotationDTO.returnFlight.departureCity}" />
								
								<h:outputText value="Arrival city" />
								<h:outputText value="#{PrenotationDTO.returnFlight.arrivalCity}" />
								
								<h:outputText value="Price" />
								<h:outputText value="#{PrenotationDTO.returnFlight.price}" />
							</p:panelGrid>
							
						</p:column>
						
						<p:column headerText="Hotel">
							<p:panelGrid columns="2" cellpadding="3">
								<h:outputText value="Id" />
								<h:outputText value="#{PrenotationDTO.hotelChosen.id}" />
								
								<h:outputText value="Name" />
								<h:outputText value="#{PrenotationDTO.hotelChosen.name}" />
								
								<h:outputText value="City" />
								<h:outputText value="#{PrenotationDTO.hotelChosen.city}" />
								
								<h:outputText value="Address" />
								<h:outputText value="#{PrenotationDTO.hotelChosen.address}" />
								
								<h:outputText value="Description" />
								<h:outputText value="#{PrenotationDTO.hotelChosen.description}" />
								
								<h:outputText value="Stars" />
								<h:outputText value="#{PrenotationDTO.hotelChosen.stars}" />
								
								<h:outputText value="Price" />
								<h:outputText value="#{PrenotationDTO.hotelChosen.price}" />
							</p:panelGrid>
							
						</p:column>
						
						<p:column headerText="Excursion">
							<p:panelGrid columns="2" cellpadding="3">
								<h:outputText value="Name" />
								<h:outputText value="#{PrenotationDTO.excursioneChosen.name}" />
								
								<h:outputText value="Description" />
								<h:outputText value="#{PrenotationDTO.excursioneChosen.description}" />
								
								<h:outputText value="Price" />
								<h:outputText value="#{PrenotationDTO.excursioneChosen.price}" />
							</p:panelGrid>
							
						</p:column>
						
						<p:column headerText="Price">
							<p:panelGrid columns="2" cellpadding="3">
								<h:outputText value="Price(EUR)" />
								<h:outputText value="#{PrenotationDTO.price}" />

							</p:panelGrid>
						</p:column>
						
						
						
				</p:dataTable>
			
			</p:panel>
		
		</p:panel>
	</div>

</body> 
</html>
